package com.stack;

/**
 * @author xiangui
 * 描述:
 * 时间: Create in 10:47 2018/7/11
 */
public class JavaVMStackOOM {

    private void dontStop(){
        while (true){

        }
    }
    public void stackLeakByThread(){
        while (true){
            Thread thread = new Thread(new Runnable() {
                @Override
                public void run() {
                    dontStop();
                }
            });
            thread.start();
        }
    }

    public static void main(String[] args) {
        JavaVMStackOOM javaVMStackOOM = new JavaVMStackOOM();

        javaVMStackOOM.stackLeakByThread();
    }

}
